# **********************************************************************
#
# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
#
# **********************************************************************

# Ice version 3.3.1
# Generated from file `Audio.ice'

import Ice, IcePy, __builtin__

if not Ice.__dict__.has_key("_struct_marker"):
    Ice._struct_marker = object()
import TeRKCommon_ice

# Included module Ice
_M_Ice = Ice.openModule('Ice')

# Included module Glacier2
_M_Glacier2 = Ice.openModule('Glacier2')

# Included module peer
_M_peer = Ice.openModule('peer')

# Included module TeRK
_M_TeRK = Ice.openModule('TeRK')

# Start of module TeRK
__name__ = 'TeRK'

if not _M_TeRK.__dict__.has_key('AudioMode'):
    _M_TeRK.AudioMode = Ice.createTempClass()
    class AudioMode(object):

        def __init__(self, val):
            assert(val >= 0 and val < 2)
            self.value = val

        def __str__(self):
            if self.value == 0:
                return 'AudioTone'
            elif self.value == 1:
                return 'AudioClip'
            return None

        __repr__ = __str__

        def __hash__(self):
            return self.value

        def __cmp__(self, other):
            return cmp(self.value, other.value)

    AudioMode.AudioTone = AudioMode(0)
    AudioMode.AudioClip = AudioMode(1)

    _M_TeRK._t_AudioMode = IcePy.defineEnum('::TeRK::AudioMode', AudioMode, (), (AudioMode.AudioTone, AudioMode.AudioClip))

    _M_TeRK.AudioMode = AudioMode
    del AudioMode

if not _M_TeRK.__dict__.has_key('AudioCommandException'):
    _M_TeRK.AudioCommandException = Ice.createTempClass()
    class AudioCommandException(_M_TeRK.CommandException):
        def __init__(self, reason=''):
            _M_TeRK.CommandException.__init__(self, reason)

        def ice_name(self):
            return 'TeRK::AudioCommandException'

        def __str__(self):
            return IcePy.stringifyException(self)

        __repr__ = __str__

    _M_TeRK._t_AudioCommandException = IcePy.defineException('::TeRK::AudioCommandException', AudioCommandException, (), _M_TeRK._t_CommandException, ())
    AudioCommandException.ice_type = _M_TeRK._t_AudioCommandException

    _M_TeRK.AudioCommandException = AudioCommandException
    del AudioCommandException

if not _M_TeRK.__dict__.has_key('AudioCommandQueueFullException'):
    _M_TeRK.AudioCommandQueueFullException = Ice.createTempClass()
    class AudioCommandQueueFullException(_M_TeRK.AudioCommandException):
        def __init__(self, reason=''):
            _M_TeRK.AudioCommandException.__init__(self, reason)

        def ice_name(self):
            return 'TeRK::AudioCommandQueueFullException'

        def __str__(self):
            return IcePy.stringifyException(self)

        __repr__ = __str__

    _M_TeRK._t_AudioCommandQueueFullException = IcePy.defineException('::TeRK::AudioCommandQueueFullException', AudioCommandQueueFullException, (), _M_TeRK._t_AudioCommandException, ())
    AudioCommandQueueFullException.ice_type = _M_TeRK._t_AudioCommandQueueFullException

    _M_TeRK.AudioCommandQueueFullException = AudioCommandQueueFullException
    del AudioCommandQueueFullException

if not _M_TeRK.__dict__.has_key('AudioFileTooLargeException'):
    _M_TeRK.AudioFileTooLargeException = Ice.createTempClass()
    class AudioFileTooLargeException(_M_TeRK.AudioCommandException):
        def __init__(self, reason=''):
            _M_TeRK.AudioCommandException.__init__(self, reason)

        def ice_name(self):
            return 'TeRK::AudioFileTooLargeException'

        def __str__(self):
            return IcePy.stringifyException(self)

        __repr__ = __str__

    _M_TeRK._t_AudioFileTooLargeException = IcePy.defineException('::TeRK::AudioFileTooLargeException', AudioFileTooLargeException, (), _M_TeRK._t_AudioCommandException, ())
    AudioFileTooLargeException.ice_type = _M_TeRK._t_AudioFileTooLargeException

    _M_TeRK.AudioFileTooLargeException = AudioFileTooLargeException
    del AudioFileTooLargeException

if not _M_TeRK.__dict__.has_key('AudioCommand'):
    _M_TeRK.AudioCommand = Ice.createTempClass()
    class AudioCommand(object):
        def __init__(self, mode=_M_TeRK.AudioMode.AudioTone, frequency=0, amplitude=0, duration=0, sound=None):
            self.mode = mode
            self.frequency = frequency
            self.amplitude = amplitude
            self.duration = duration
            self.sound = sound

        def __hash__(self):
            _h = 0
            _h = 5 * _h + __builtin__.hash(self.mode)
            _h = 5 * _h + __builtin__.hash(self.frequency)
            _h = 5 * _h + __builtin__.hash(self.amplitude)
            _h = 5 * _h + __builtin__.hash(self.duration)
            if self.sound:
                for _i0 in self.sound:
                    _h = 5 * _h + __builtin__.hash(_i0)
            return _h % 0x7fffffff

        def __cmp__(self, other):
            if other == None:
                return 1
            if self.mode < other.mode:
                return -1
            elif self.mode > other.mode:
                return 1
            if self.frequency < other.frequency:
                return -1
            elif self.frequency > other.frequency:
                return 1
            if self.amplitude < other.amplitude:
                return -1
            elif self.amplitude > other.amplitude:
                return 1
            if self.duration < other.duration:
                return -1
            elif self.duration > other.duration:
                return 1
            if self.sound < other.sound:
                return -1
            elif self.sound > other.sound:
                return 1
            return 0

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_AudioCommand)

        __repr__ = __str__

    _M_TeRK._t_AudioCommand = IcePy.defineStruct('::TeRK::AudioCommand', AudioCommand, (), (
        ('mode', (), _M_TeRK._t_AudioMode),
        ('frequency', (), IcePy._t_int),
        ('amplitude', (), IcePy._t_byte),
        ('duration', (), IcePy._t_int),
        ('sound', (), _M_TeRK._t_ByteArray)
    ))

    _M_TeRK.AudioCommand = AudioCommand
    del AudioCommand

if not _M_TeRK.__dict__.has_key('AudioController'):
    _M_TeRK.AudioController = Ice.createTempClass()
    class AudioController(_M_TeRK.AbstractCommandController):
        def __init__(self):
            if __builtin__.type(self) == _M_TeRK.AudioController:
                raise RuntimeError('TeRK.AudioController is an abstract class')

        def ice_ids(self, current=None):
            return ('::Ice::Object', '::TeRK::AbstractCommandController', '::TeRK::AudioController', '::TeRK::PropertyManager')

        def ice_id(self, current=None):
            return '::TeRK::AudioController'

        def ice_staticId():
            return '::TeRK::AudioController'
        ice_staticId = staticmethod(ice_staticId)

        #
        # Operation signatures.
        #
        # def execute(self, command, current=None):

        def __str__(self):
            return IcePy.stringify(self, _M_TeRK._t_AudioController)

        __repr__ = __str__

    _M_TeRK.AudioControllerPrx = Ice.createTempClass()
    class AudioControllerPrx(_M_TeRK.AbstractCommandControllerPrx):

        def execute(self, command, _ctx=None):
            return _M_TeRK.AudioController._op_execute.invoke(self, ((command, ), _ctx))

        def execute_async(self, _cb, command, _ctx=None):
            return _M_TeRK.AudioController._op_execute.invokeAsync(self, (_cb, (command, ), _ctx))

        def checkedCast(proxy, facetOrCtx=None, _ctx=None):
            return _M_TeRK.AudioControllerPrx.ice_checkedCast(proxy, '::TeRK::AudioController', facetOrCtx, _ctx)
        checkedCast = staticmethod(checkedCast)

        def uncheckedCast(proxy, facet=None):
            return _M_TeRK.AudioControllerPrx.ice_uncheckedCast(proxy, facet)
        uncheckedCast = staticmethod(uncheckedCast)

    _M_TeRK._t_AudioControllerPrx = IcePy.defineProxy('::TeRK::AudioController', AudioControllerPrx)

    _M_TeRK._t_AudioController = IcePy.defineClass('::TeRK::AudioController', AudioController, (), True, None, (_M_TeRK._t_AbstractCommandController,), ())
    AudioController.ice_type = _M_TeRK._t_AudioController

    AudioController._op_execute = IcePy.Operation('execute', Ice.OperationMode.Normal, Ice.OperationMode.Normal, False, (), (((), _M_TeRK._t_AudioCommand),), (), None, (_M_TeRK._t_AudioCommandException,))

    _M_TeRK.AudioController = AudioController
    del AudioController

    _M_TeRK.AudioControllerPrx = AudioControllerPrx
    del AudioControllerPrx

# End of module TeRK
